//
//  ContentView.swift
//  SwiftUIStacks
//
//  Created by bj_szd on 2024/11/6.
//

import SwiftUI

struct ContentView: View {
    var body: some View {
        VStack(alignment: .leading, spacing: 10) {
            Text("会员套餐")
                .fontWeight(.bold)
                .font(.system(.title))
            Text("解锁高级功能")
                .fontWeight(.bold)
                .font(.system(.title))
            Spacer()
                .frame(height: 15)
            HStack {
                ZStack {
                    VStack {
                        Text("连续包月")
                            .fontWeight(.bold)
                            .font(.system(size: 17))
                            .foregroundColor(.gray)
                        Text("¥18")
                            .fontWeight(.bold)
                            .font(.system(size: 30))
                            .foregroundColor(.red)
                    }
                    .frame(minWidth: 0, maxWidth: .infinity, minHeight: 90)
                    .padding(20)
                    .background(Color.orange)
                    .cornerRadius(10)
                .overlay(RoundedRectangle(cornerRadius: 10).stroke(Color.black).lineLimit(2))
                    
                    Text("首月特惠")
                        .font(.system(size: 14))
                        .fontWeight(.bold)
                        .foregroundColor(.white)
                        .padding(5)
                        .background(Color.red)
                        .cornerRadius(4)
                        .offset(x: 0, y: -65)
                }
                
                VStack {
                    Text("1个月")
                        .fontWeight(.bold)
                        .font(.system(size: 17))
                        .foregroundColor(.gray)
                    Text("¥30")
                        .fontWeight(.bold)
                        .font(.system(size: 30))
                        .foregroundColor(.red)
                }
                .frame(minWidth: 0, maxWidth: .infinity, minHeight: 90)
                .padding(20)
                .background(Color.orange)
                .cornerRadius(10)
                .overlay(RoundedRectangle(cornerRadius: 10).stroke(Color.black).lineLimit(2))
                
                VStack {
                    Text("12个月")
                        .fontWeight(.bold)
                        .font(.system(size: 17))
                        .foregroundColor(.gray)
                    Text("¥228")
                        .fontWeight(.bold)
                        .font(.system(size: 30))
                        .foregroundColor(.red)
                }
                .frame(minWidth: 0, maxWidth: .infinity, minHeight: 90)
                .padding(20)
                .background(Color.orange)
                .cornerRadius(10)
                .overlay(RoundedRectangle(cornerRadius: 10).stroke(Color.black).lineLimit(2))
            }
        }
        .padding(.horizontal)
    }
}

struct ContentView_Previews: PreviewProvider {
    static var previews: some View {
        ContentView()
    }
}
